LengthIndicator

StockSharp.Algo.Indicators

The base class for indicators with one resulting value and based on the period.

Inherits: BaseIndicator

Constructors

LengthIndicator
protected LengthIndicator(TBuffer buffer)
lengthIndicator = LengthIndicator(buffer)

The base class for indicators with one resulting value and based on the period.

buffer
Buffer

Properties

Buffer
protected TBuffer Buffer { get; }
value = lengthIndicator.Buffer

The buffer for data storage.

Length
public virtual int Length { get; set; }
value = lengthIndicator.Length
lengthIndicator.Length = value

Period length. By default equal to 1.

NumValuesToInitialize
public override int NumValuesToInitialize { get; }
value = lengthIndicator.NumValuesToInitialize

Number of values that need to be processed in order for the indicator to initialize (be IsFormed equals ). if undefined.

Methods

CalcIsFormed
protected override bool CalcIsFormed()
result = lengthIndicator.CalcIsFormed()

Calc IsFormed.

Returns: IsFormed

GetCapacity
protected virtual int GetCapacity()
result = lengthIndicator.GetCapacity()

Gets the capacity of the buffer for data storage.

Returns: The capacity of the buffer. By default, it is equal to Length.

LoadAsync
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = lengthIndicator.LoadAsync(storage, cancellationToken)

Load settings.

storage
Settings storage.
cancellationToken
CancellationToken

Returns: Task

OnProcess
protected override IIndicatorValue OnProcess(IIndicatorValue input)
result = lengthIndicator.OnProcess(input)

To handle the input value.

input
The input value.

Returns: The resulting value.

OnProcessDecimal
protected virtual decimal? OnProcessDecimal(IIndicatorValue input)
result = lengthIndicator.OnProcessDecimal(input)

To handle the input value.

input
The input value.

Returns: The new value of the indicator.

Reset
public override void Reset()
lengthIndicator.Reset()

To reset the indicator status to initial. The method is called each time when initial settings are changed (for example, the length of period).

SaveAsync
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = lengthIndicator.SaveAsync(storage, cancellationToken)

Save settings.

storage
Settings storage.
cancellationToken
CancellationToken

Returns: Task

ToString
public override string ToString()
result = lengthIndicator.ToString()

Returns a string representation of the tuple, with values separated by commas.

Returns: A string representing the tuple's values.